private void btnSaveEmailActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: try { x = new Formatter("Clients.txt"); //Creates a new file by using Formatter class } catch (FileNotFoundException ex) { Logger.getLogger(USF_JFrame.class.getName()).log(Level.SEVERE, null, ex); } Integer tokNo=Integer.parseInt(txtTokenNo.getText()); //calls getText method to get the text from the txtTokenNo textbox x.format("%-25s %-20d \n" + System.getProperty("line.separator"),"Token No: ",tokNo); //puts the formatted text in the created text file Integer EmpId=Integer.parseInt(txtEmployeeID.getText()); //calls getText method to get the text from the txtEmployeeID textbox x.format("\n%-25s %-20d \n" + System.getProperty("line.separator"),"Employee id: ",EmpId); //puts the formatted text in the created text file Date getTrnDate=jDateChooser.getDate(); //calls getText method to get the text from the txtTranDate textbox String trnDate=String.format("%1$td-%1$tm-%1$tY",getTrnDate); x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Transaction date: ",trnDate); //puts the formatted text in the created text file String roomNo=txtRoomNo.getText(); //calls getText method to get the text from the txtRoomNo textbox x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Room No: ",roomNo); //puts the formatted text in the created text file Integer extNo=Integer.parseInt(txtExtNo.getText()); //calls getText method to get the text from the txExtNo textbox x.format("\n%-25s %-20d \n" + System.getProperty("line.separator"),"Extension is: ",extNo); //puts the formatted text in the created text file String empName=txtEmployeeName.getText(); //calls getText method to get the text from the txtEmployeeName textbox x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Employee Name: ",empName); //puts the formatted text in the created text file String loc=txtLocation.getText(); //calls getText method to get the text from the txtLocation textbox x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Location is: ",loc); //puts the formatted text in the created text file String dptName=txtDeptName.getText(); //calls getText method to get the text from the txtDeptName textbox x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Department Name: ",dptName); //puts the formatted text in the created text file String probType=(String)cbProbType.getSelectedItem(); //calls getSelectedItem method to get the list item from the cbProbType DropDownList x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Problem Type: ",probType); //puts the formatted text in the created text file String urgType=(String)cbUrgencyType.getSelectedItem(); //calls getSelectedItem method to get the list item from the cbUrgencyType DropDownList x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Urgency Type: ",urgType); //puts the formatted text in the created text file String appType=(String)cbAppType.getSelectedItem(); //calls getSelectedItem method to get the list item from the cbAppType DropDownList x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Application Type: ",appType); //puts the formatted text in the created text file String jStatusType=(String)cbJobStatusType.getSelectedItem(); //calls getSelectedItem method to get the list item from the cbJobStatusType DropDownList x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Job Status Type: ",jStatusType); //puts the formatted text in the created text file String desc=txtDescription.getText(); //calls getText method to get the text from the txtDescription textbox x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Description: ",desc); //puts the formatted text in the created text file x.close(); }private void btnSaveEmailActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: try { x = new Formatter("Clients.txt"); //Creates a new file by using Formatter class } catch (FileNotFoundException ex) { Logger.getLogger(USF_JFrame.class.getName()).log(Level.SEVERE, null, ex); } Integer tokNo=Integer.parseInt(txtTokenNo.getText()); //calls getText method to get the text from the txtTokenNo textbox x.format("%-25s %-20d \n" + System.getProperty("line.separator"),"Token No: ",tokNo); //puts the formatted text in the created text file Integer EmpId=Integer.parseInt(txtEmployeeID.getText()); //calls getText method to get the text from the txtEmployeeID textbox x.format("\n%-25s %-20d \n" + System.getProperty("line.separator"),"Employee id: ",EmpId); //puts the formatted text in the created text file Date getTrnDate=jDateChooser.getDate(); //calls getText method to get the text from the txtTranDate textbox String trnDate=String.format("%1$td-%1$tm-%1$tY",getTrnDate); x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Transaction date: ",trnDate); //puts the formatted text in the created text file String roomNo=txtRoomNo.getText(); //calls getText method to get the text from the txtRoomNo textbox x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Room No: ",roomNo); //puts the formatted text in the created text file Integer extNo=Integer.parseInt(txtExtNo.getText()); //calls getText method to get the text from the txExtNo textbox x.format("\n%-25s %-20d \n" + System.getProperty("line.separator"),"Extension is: ",extNo); //puts the formatted text in the created text file String empName=txtEmployeeName.getText(); //calls getText method to get the text from the txtEmployeeName textbox x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Employee Name: ",empName); //puts the formatted text in the created text file String loc=txtLocation.getText(); //calls getText method to get the text from the txtLocation textbox x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Location is: ",loc); //puts the formatted text in the created text file String dptName=txtDeptName.getText(); //calls getText method to get the text from the txtDeptName textbox x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Department Name: ",dptName); //puts the formatted text in the created text file String probType=(String)cbProbType.getSelectedItem(); //calls getSelectedItem method to get the list item from the cbProbType DropDownList x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Problem Type: ",probType); //puts the formatted text in the created text file String urgType=(String)cbUrgencyType.getSelectedItem(); //calls getSelectedItem method to get the list item from the cbUrgencyType DropDownList x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Urgency Type: ",urgType); //puts the formatted text in the created text file String appType=(String)cbAppType.getSelectedItem(); //calls getSelectedItem method to get the list item from the cbAppType DropDownList x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Application Type: ",appType); //puts the formatted text in the created text file String jStatusType=(String)cbJobStatusType.getSelectedItem(); //calls getSelectedItem method to get the list item from the cbJobStatusType DropDownList x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Job Status Type: ",jStatusType); //puts the formatted text in the created text file String desc=txtDescription.getText(); //calls getText method to get the text from the txtDescription textbox x.format("\n%-25s %-20s \n" + System.getProperty("line.separator"),"Description: ",desc); //puts the formatted text in the created text file x.close(); }